import { createRouter, createWebHistory } from 'vue-router'
import { routerArray } from './routes'

const router = createRouter({
	history: createWebHistory(import.meta.env.BASE_URL),
	routes: [
		{
			path: '/login',
			name: 'login',
			component: () => import('@/views/login/index.vue'),
		},
		{
			path: '/404',
			name: '404',
			component: () => import('@/views/error/404.vue'),
		},
		...routerArray,
		{ path: '/:pathMatch(.*)*', redirect: '/404' },
	],
})

export default router
